;;;; Run test suites that parse and compile programs to exercise
;;;; specific areas of functionality.
;;;;
;;;; See tests/test-files/README.md for input format and options.
;;;; See tests/loader.lisp and tests/utilities.lisp for load and
;;;; execution functions.

(in-package #:coalton-tests)

(defun %run-tests (name)
  (run-test-file (format nil "tests/test-files/~a" name)))

(deftest test-coalton-lang ()
  (%run-tests "define-class.txt")
  (%run-tests "define-instance.txt")
  (%run-tests "define-type.txt")
  (%run-tests "define-type-alias.txt")
  (%run-tests "define.txt")
  (%run-tests "fundeps.txt")
  (%run-tests "hashtable.txt")
  (%run-tests "lisp-toplevel-forbid.txt")
  (let ((*features* (cons ':coalton-lisp-toplevel *features*)))
    (%run-tests "lisp-toplevel.txt"))
  (%run-tests "package.txt")
  (%run-tests "parse-attribute.txt")
  (%run-tests "parse-body.txt")
  (%run-tests "parse-break.txt")
  (%run-tests "parse-cond.txt")
  (%run-tests "parse-continue.txt")
  (%run-tests "parse-declare.txt")
  (%run-tests "parse-do.txt")
  (%run-tests "parse-expression.txt")
  (%run-tests "parse-fn.txt")
  (%run-tests "parse-for.txt")
  (%run-tests "parse-if.txt")
  (%run-tests "parse-let.txt")
  (%run-tests "parse-rec.txt")
  (%run-tests "parse-lisp.txt")
  (%run-tests "parse-loop.txt")
  (%run-tests "parse-match.txt")
  (%run-tests "parse-method.txt")
  (%run-tests "parse-pattern.txt")
  (%run-tests "parse-return.txt")
  (%run-tests "parse-the.txt")
  (%run-tests "parse-toplevel.txt")
  (%run-tests "parse-type.txt")
  (%run-tests "parse-unless.txt")
  (%run-tests "parse-when.txt")
  (%run-tests "parse-while-let.txt")
  (%run-tests "parse-while.txt")
  (%run-tests "recursive-let.txt")
  (%run-tests "struct.txt")
  (%run-tests "toplevel-progn.txt")
  (%run-tests "type-inference.txt")
  (%run-tests "unicode.txt")
  (%run-tests "unused-variables.txt")
  (%run-tests "parse-throw.txt")
  (%run-tests "parse-resume-to.txt")
  (%run-tests "parse-catch.txt")
  (%run-tests "parse-resumable.txt"))
